package com.study.rpc;

import com.study.rpc.service.StudentService;
import com.study.rpc.service.dto.Student;

import java.io.IOException;

/**
 * @version V1.0
 * @title: Main
 * @description: ${DESCRIPTION}
 * @author: wanghuilong
 * @date: 2019-11-11 17:54
 * @copyright: http://fingo.com.my/
 */
public class MainApplication {

    public static void main(String[] args) {
        new Thread(() -> {
            try {
                RpcServer rpcServer = new RpcServer(12000);
                rpcServer.start();
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }
        }).start();

        SocketClientProxy proxy = new SocketClientProxy();
        StudentService studentService = proxy.getProxy(StudentService.class);
        Student student = studentService.getInfo();
        System.out.println(student);
    }

}
